package test1;

import java.io.DataInputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.security.Provider;

public class server {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(5677);
        Socket accept = serverSocket.accept();

        DataInputStream dti = new DataInputStream(accept.getInputStream());
        String s = dti.readUTF();
        System.out.println(accept.getRemoteSocketAddress()+"上线了");
        System.out.println(s);
        dti.close();
        serverSocket.close();
    }
}
